<?php $this->load->view('headerfooter/header'); ?>

      <!-- Begin page content -->
<div class="container">
	<div class="col-sm-4 col-sm-offset-1">
		<div class="panel panel-success">
			<div class="panel-heading">
			  <div class="panel-title">
				<?php
				$princat = array();
				for($i = count($breadcrumb)-1; $i>=0 ; $i--){ $printcat = $breadcrumb[$i]; ?>
					<?=$printcat['nama_kategori']?>
					<?php if($i != 0){?> » <?php } ?>
				<?php } ?></div>
			</div>
			<div class="panel-isi">
				<?php if (!isset($message)) : ?>
					<table class="table">
						<?php foreach ($hasil->result() as $row) : ?>
							<tr>
								<td><strong>Nomer Surat</strong></td>
								<td><?= $row->nomersurat ?></td>
							</tr>
							<tr>
								<td><strong>Nama Instansi</strong></td>
								<td><?= $row->nama_instansi ?></td>
							</tr>
							<tr>
								<td><strong>Tanggal Kerjasama</strong></td>
								<td><?= $row->tanggal_kerjasama ?></td>
							</tr>
							<tr>
								<td><strong>Masa Berlaku</strong></td>
								<td><?= $row->masa_berlaku ?></td>
							</tr>
							<tr>
								<td><strong>Deskripsi</strong></td>
								<td><?= $row->deskripsi ?></td>
							</tr>
							<tr>
								<td><strong>Unit Terkait</strong></td>
								<td><?= $row->unit_terkait ?></td>
							</tr>
							<tr>
								<td><strong>Implementasi</strong></td>
								<td><?= $row->implementasi?></td>
							</tr>
					</table>
					<div class="text-center">
					<?php if($this->session->userdata('role') != 3) : ?>
						<a class="btn btn-lg btn-primary" href="<?=site_url('surat/edit/'.$row->idsurat)?>">
							<i class="fa fa-edit"></i> Edit
						</a>
					<?php endif;?>
						<a class="btn btn-lg btn-danger" href="<?=site_url()?>/surat/download/<?=$row->scan_file?>">
							<i class="fa fa-download"></i> Download File
						</a>
					</div>
					<?php endforeach; ?>
					<?php else : ?>
					<h2><?= $message ?></h2>
				<?php endif; ?>
			</div>
		</div>
	</div>
</div>
<?php $this->load->view('headerfooter/footer'); ?>